package string;

import sun.nio.cs.SingleByte;

import java.util.Locale;

public class Trim1 {
    public static void main(String[] args) {
        /*
        String str = "我爱java!";
        int len = str.length();
        System.out.println(len);

         */
        /*
        String str = "   hello word   ";
        str = str.trim();
        System.out.println(str);
        */
        /*
        String str = "我爱Java";
        String upper = str.toUpperCase();
        System.out.println(upper);
        String lower = str.toLowerCase();
        System.out.println(lower);
        */
        /*
        String str = "thinking in java";
        boolean starts = str.startsWith("think");
        System.out.println(starts);
        boolean ends = str.endsWith(".png");
        System.out.println(ends);
        */
        /*
        String str = "thinking in java";
        char c = str.charAt(9);
        System.out.println(c);
*/
        /*
        String str = "thinking in java";
        int index = str.indexOf("in");
        System.out.println(index);
        index = str.indexOf("in",3);
        System.out.println(index);
        index = str.indexOf("abc");
        System.out.println(index);
        index = str.lastIndexOf("in");
        System.out.println(index);
        */
        /*
        String str = "www.tedu.cn";
        int start = str.indexOf(".")+1;
        int end = str.indexOf(".",start);
        String name = str.substring(start,end);
        System.out.println(name);
         */
        /*
        int a = 123;
        String s1 = String.valueOf(a);
        System.out.println(s1);
        double b = 123.456;
        String s2 = String.valueOf(b);
        System.out.println(s2);
        String s3 = b+"";
        System.out.println(s3);
         */
        /*
        String str = "  hello word   ";
        str =str.trim();
        System.out.println(str);
        */
        /*
        StringBuilder s = new StringBuilder("a");
        for (int i=0;i<1000000;i++){
            s.append(i);
        }
        System.out.println("执行完毕...");
        */
        /*
        String s = new String("hello");
        String s1 = "hello";
        System.out.println(s==s1);
        System.out.println(s.equals(s1));
        */
        /*
        String str = "好好学习Java";
        StringBuilder builder = new StringBuilder(str);

        builder.append(",为了找个好工作");
        System.out.println(builder);

        builder.replace(9, 16, "就是为了改变世界");
        System.out.println(builder);

        builder.delete(0, 8);
        System.out.println(builder);

        builder.insert(0, "活着");
        System.out.println(builder);
        */
        /*
        String str = "我爱java!";
        int len = str.length();
        System.out.println(len);

         */
         /*
        String str = "   hello word   ";
        str = str.trim();
        System.out.println(str);
        */
        /*
        String str = "我爱Java";
        String upper = str.toUpperCase();
        System.out.println(upper);
        String lower = str.toLowerCase();
        System.out.println(lower);
        */
        /*
        String str = "thinking in java";
        boolean starts = str.startsWith("think");
        System.out.println(starts);
        boolean ends = str.endsWith(".png");
        System.out.println(ends);
        */
        /*
        String str = "thinking in java";
        char c = str.charAt(9);
        System.out.println(c);
*/
        /*
        String str = "thinking in java";
        int index = str.indexOf("in");
        System.out.println(index);
        index = str.indexOf("in",3);
        System.out.println(index);
        index = str.indexOf("abc");
        System.out.println(index);
        index = str.lastIndexOf("in");
        System.out.println(index);
        */
        /*
        String str = "www.tedu.cn";
        int start = str.indexOf(".")+1;
        int end = str.indexOf(".",start);
        String name = str.substring(start,end);
        System.out.println(name);
         */
        /*
        int a = 123;
        String s1 = String.valueOf(a);
        System.out.println(s1);
        double b = 123.456;
        String s2 = String.valueOf(b);
        System.out.println(s2);
        String s3 = b+"";
        System.out.println(s3);
         */
        /*
        String str = "hello word   ";
        str =str.trim();
        System.out.println(str);
        */
        /*
        StringBuilder s = new StringBuilder("a");
        for (int i=0;i<1000000;i++){
            s.append(i);
        }
        System.out.println("执行完毕...");
        */
        /*
        String s = new String("hello");
        String s1 = "hello";
        System.out.println(s==s1);
        System.out.println(s.equals(s1));
        */
        /*
        String str = "好好学习Java";
        StringBuilder builder = new StringBuilder(str);

        builder.append(",为了找个好工作");
        System.out.println(builder);

        builder.replace(9, 16, "就是为了改变世界");
        System.out.println(builder);

        builder.delete(0, 8);
        System.out.println(builder);

        builder.insert(0, "活着");
        System.out.println(builder);
        */


    }
}
